#判断小数
#'1.5'
def is_float (s):
    s = str(s)
    if s.count('.')==1:
        left,right = s.split('.')
        if left.isdigit()and right.isdigit():
            return True
        if left[0]=='-'and left[1:].isdigit()and right.isdigit():
            return True
    return False
result = is_float('1.5')
print(result)

# 函数里面遇到return,函数立马结束